#ifndef __EVENTLOOPTHREADPOOL_H__
#define __EVENTLOOPTHREADPOOL_H__

#include <vector>
#include <memory>
#include "Base/noncopyable.h"

namespace tiny_muduo
{
    class EventLoopThread;
    class EventLoop;

    class EventLoopThreadPool : public NonCopyable
    {
    public:
        typedef std::vector<std::unique_ptr<EventLoopThread>> Threads;
        typedef std::vector<EventLoop*> Loops;

        EventLoopThreadPool(EventLoop* loop);
        ~EventLoopThreadPool();

        void SetThreadNums(int thread_nums)
        {
            thread_nums_ = thread_nums;
        }

        void StartLoop();
        EventLoop* NextLoop();

    private:
        EventLoop* base_loop_;
        Threads threads_;
        Loops loops_;

        int thread_nums_;
        int next_;
    };
}
#endif
